package com.film.filmweb.service.impl;

import java.util.List;
import com.film.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.film.filmweb.mapper.MovieBannerMapper;
import com.film.filmweb.domain.MovieBanner;
import com.film.filmweb.service.IMovieBannerService;

/**
 * 首页bannerService业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-05
 */
@Service
public class MovieBannerServiceImpl implements IMovieBannerService 
{
    @Autowired
    private MovieBannerMapper movieBannerMapper;

    /**
     * 查询首页banner
     * 
     * @param bannerId 首页banner主键
     * @return 首页banner
     */
    @Override
    public MovieBanner selectMovieBannerByBannerId(Integer bannerId)
    {
        return movieBannerMapper.selectMovieBannerByBannerId(bannerId);
    }

    /**
     * 查询首页banner列表
     * 
     * @param movieBanner 首页banner
     * @return 首页banner
     */
    @Override
    public List<MovieBanner> selectMovieBannerList(MovieBanner movieBanner)
    {
        return movieBannerMapper.selectMovieBannerList(movieBanner);
    }

    /**
     * 新增首页banner
     * 
     * @param movieBanner 首页banner
     * @return 结果
     */
    @Override
    public int insertMovieBanner(MovieBanner movieBanner)
    {
        movieBanner.setCreateTime(DateUtils.getNowDate());
        return movieBannerMapper.insertMovieBanner(movieBanner);
    }

    /**
     * 修改首页banner
     * 
     * @param movieBanner 首页banner
     * @return 结果
     */
    @Override
    public int updateMovieBanner(MovieBanner movieBanner)
    {
        return movieBannerMapper.updateMovieBanner(movieBanner);
    }

    /**
     * 批量删除首页banner
     * 
     * @param bannerIds 需要删除的首页banner主键
     * @return 结果
     */
    @Override
    public int deleteMovieBannerByBannerIds(Integer[] bannerIds)
    {
        return movieBannerMapper.deleteMovieBannerByBannerIds(bannerIds);
    }

    /**
     * 删除首页banner信息
     * 
     * @param bannerId 首页banner主键
     * @return 结果
     */
    @Override
    public int deleteMovieBannerByBannerId(Integer bannerId)
    {
        return movieBannerMapper.deleteMovieBannerByBannerId(bannerId);
    }
}
